<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/spring.tld"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld"%>
<c:set var="BasePath" value="${pageContext.request.contextPath}"></c:set>
<c:set var="Plugins" value="${pageContext.request.contextPath}/res/plugins"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品条码管理</title>
<link href="${Plugins}/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/jquery/jquery-1.3.2.min.js"	type="text/javascript"></script>
<link href="${Plugins}/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<script src="${Plugins}/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="${Plugins}/datepicker/WdatePicker.js" type="text/javascript"></script>
<script type="text/javascript" src="${BasePath}/res/js/ligerCommon.js"></script>
<c:set var="isAddPage" value="${stockInViewType == 1}" />
<c:set var="isAduitPage" value="${stockInViewType == 2}" />
<c:set var="isDetailPage" value="${stockInViewType == 3}" />
<c:set var="isPurBillImportPage" value="${stockInViewType == 4}" />
<c:set var="isBookBillImportPage" value="${stockInViewType == 6}" />

<c:set var="isPurchaseBillData" value="${stockIn.stockInType == 1}" />
<c:set var="isBookBillData" value="${stockIn.stockInType == 2}" />
<c:set var="isDefectReturnData" value="${stockIn.stockInType == 3}" />
<c:set var="isPurReturnData" value="${stockIn.stockInType == 4}" />
<c:set var="isTransferData" value="${stockIn.stockInType == 5}" />
<c:set var="isAduitedData" value="${stockIn.stockInState == 1}" />

<style type="text/css">
#searchbar{
   margin-bottom: 10px;
   margin-left:15px;
  }
  .navbar {
		height: 20px;
		border-bottom: #E6E6E6 solid 1px;
		line-height: 20px;
	}
.l-button-search {
	width: 50px;
	margin-left: 10px;
	padding-bottom: 2px;
	display: inline;
}
.inputSize {
	width: 150px;
}
select{
	width: 150px;
	font-size: 12px;
}
td{
	font-size: 12px
}
</style>
</head>
<body style="padding:6px; overflow:hidden;">
<div class="navbar">
		<span>您当前的位置：</span>
		出入库管理  &gt;入库管理 &gt;查看条形码
</div>

<form action="../../stockmanage/productBarCodeContrller/pageFinderProductBarCode.do" method="post" >
<div id="searchbar">
<br>
<table  style="width: 80%" border=0> 
		<tr>
			<td style="width: 50%">
				<c:if test="${stockInProductId != null}">
						<span>入库单号&nbsp;:</span>&nbsp;
						<span id="stockInNo">${stockIn.stockInNo}</span>
				</c:if>
				<c:if test="${stockOutProductId != null}">
						<span>出库单号&nbsp;:</span>&nbsp;
						<span id="stockInNo">${stockOut.stockOutNo}</span>
				</c:if>
			</td>
		</tr>
		<tr style="height: 10px"><td></td></tr>
		<tr>
			<td style="width: 50%">
				<c:if test="${stockInProductId != null}">
						<span>入库类型&nbsp;:</span>&nbsp;
						<span>
							<c:choose> 
								<c:when test="${stockIn.stockInType==1}">货品采购入库</c:when> 
								<c:when test="${stockIn.stockInType==2}">订单退换货入库</c:when> 
								<c:when test="${stockIn.stockInType==3}">次品换货入库</c:when> 
								<c:when test="${stockIn.stockInType==4}">借出归还入库</c:when> 
								<c:when test="${stockIn.stockInType==5}">调拨入库</c:when> 
								<c:when test="${stockIn.stockInType==6}">其他入库</c:when> 
								<c:otherwise></c:otherwise> 
							</c:choose> 
							<input  id = "typeSpan"  type="hidden" value="${stockIn.stockInType}">
						</span>
				</c:if>
				<c:if test="${stockOutProductId != null}">
						<span>出库类型&nbsp;:</span>&nbsp;
						<span>
							<c:choose> 
								<c:when test="${stockOut.stockOutType==-1}">包裹销售出库</c:when> 
								<c:when test="${stockOut.stockOutType==-2}">订单退货出库</c:when> 
								<c:when test="${stockOut.stockOutType==-3}">次品退货出库</c:when> 
								<c:when test="${stockOut.stockOutType==-4}">订单退换货出库</c:when> 
								<c:when test="${stockOut.stockOutType==-5}">商品调拨出库</c:when> 
								<c:otherwise></c:otherwise> 
							</c:choose> 
							<input  id = "typeSpan"  type="hidden" value="${stockOut.stockOutType}">
						</span>
				</c:if>
			</td>
		</tr>
		<c:if test="${stockInProductId != null}">
			<tr style="height: 10px"><td></td></tr>
			<tr>
				<td>
					<span> 
						<c:choose>
							<c:when test="${isPurchaseBillData}">采购单号&nbsp;:&nbsp;</c:when>
							<c:when test="${isBookBillData}">订单编号&nbsp;:&nbsp;</c:when>
							<c:when test="${isDefectReturnData}">次品退货编号&nbsp;:&nbsp;</c:when>
							<c:when test="${isPurReturnData}">采购退货编号&nbsp;:&nbsp;</c:when>
							<c:when test="${isTransferData}">调拨编号&nbsp;:&nbsp;</c:when>
							<c:otherwise></c:otherwise>
						</c:choose>
					</span> 
					<c:choose>
						<c:when test="${isPurchaseBillData}">
							<span  id="typeNoSpan">${stockIn.purNo}</span>
						</c:when>
						<c:otherwise>
							<span  id="typeNoSpan">${stockIn.stockInTypeNo}</span>
						</c:otherwise>
					</c:choose>
					</span>
				</td>
			</tr>
		</c:if>
	</table>
</div>
</form>

<div id="maingrid4" style="margin:0; padding:0"></div>
  <div style="display:none;">
  <!-- g data total ttt -->
</div>
<script>
    var basePath='${BasePath}';
    var stockInProductId='${stockInProductId}';
    var stockOutProductId='${stockOutProductId}';
    var ajaxQueryUrl = "ajaxPageFinderProductBarCode.do?stockInProductId=" + stockInProductId;
    var grid = null;
    $(function () {
		if(stockOutProductId!=null && stockOutProductId!=""){//出库
			ajaxQueryUrl = "ajaxPageFinderProductBarCode.do?stockOutProductId=" + stockOutProductId;
		}else if( $("#typeSpan").val() == 5){//调拨
		   	ajaxQueryUrl = "ajaxPageFinderProductBarCode.do?stockOutTypeNo=" + $('#typeNoSpan').html();
		}
       	grid = $("#maingrid4").ligerGrid({
               columns: [
               { display: '货品编号', name: 'prodNo'},
               { display: '商品名称', name: 'commoName'},
               { display: '货品规格', name: 'specification'},
               { display: '供应商名称', name: 'supName'},
               { display: '货品条码', name: 'codeNo'},  
               //{ display: '数量', name: 'prodQuantity'},     
               ], 
               pageSize:30,
               width: '100%',
               height: '100%',
               dataType: 'server', 
               dataAction: 'server',
               pagesizeParmName: 'pageSize',
               parms: [
                ],
                url: ajaxQueryUrl
           });
    });
</script>
</body>
</html>